/**
 * *****************************************************************
 * @file    adt3102_utilities.h
 * @author  JiangQi(qijiang@andartechs.com.cn)
 * @version 1.0.0
 * @date    2021-05-07
 * @brief   
 *                 Copyright (c) 2021, Andar Technologies Inc.
 *                           www.andartechs.com 
 *
 * *****************************************************************
 */
#ifndef __UTILITIES_H
#define __UTILITIES_H
/*------------------------------ include -------------------------------------*/
#include "adt3102_type_define.h"


/*------------------------------ define --------------------------------------*/
#define BIST_AMP 1
#define BIST_ABB 0
#define BIST_DIV2_SEL       0x01//00001
#define BIST_DIV4_SEL       0x04//00100
#define BIST_DIV8_SEL       0x02//00010
#define BIST_DIV16_SEL      0x09//01001
#define BIST_DIV32_SEL      0x06//00110
#define BIST_DIV64_SEL      0x0A//01010
#define BIST_DIV128_SEL     0x15//10101
#define BIST_DIV256_SEL     0x19//11001
#define BIST_DIV512_SEL     0x16//10110
#define BIST_DIV1024_SEL    0x1A//11010


/*----------------------------- function -------------------------------------*/
/**
 * @brief   Set FMCW to single tone mode. Tone frequency is FMCW start frequency.
 * @param   None.
 * @return  None.
 * @note
 */
void fmcwChirpSingleFrequency(void);

/**
 * @brief   Enable bist.
 * @param   bistSorSel: bist source select. 1 : from RF 0: from baseband.
 * @param   bistDivSel: bist divided frequency from 50MHz.
 * @return  None.
 * @note
 */
void bistOn(uint16 bistSorSel, uint16 bistDivSel);

/**
 * @brief   select P27 as widen_bw signal, which is an indicator for CHIRP_T0.
            It will be 1 when transmit CHIRP_T0, and it is synchornized with CHIRP_T0.
            This signal could be used as an indicator synchornized with CHIRP_T0.
 * @param   None.
 * @return  None.
 * @note
 */
void widenBwP27(void);

#endif
